<template>
  <div class="share-page-poster">
    <van-popup v-model="showDialog" :close-on-click-overlay="false">
      <div class="share-wrapper">
        <div id="recommend-poster">
          <div class="content-wrap">
            <img src="../assets/poster-bg.jpg" class="poster-bg" />
            <div class="content">
              <div class="store-info">
                <div class="store-name">喜茶小茶生活名品馆</div>
                <div class="store-col">
                  <img src="" class="avatar" />
                  <div>
                    <p class="nickname">1111</p>
                    <p class="slogan">222222</p>
                  </div>
                </div>
              </div>
              <div class="qrcode-wrap">
                <img class="qrcode" src="" />
                <p class="qrcode-des">扫描或长按识别</p>
              </div>
            </div>
          </div>
          <img src="../assets/bottom-img.png" class="img-share" />
        </div>
      </div>
    </van-popup>
    <van-loading color="white" v-show="loading" class="loading" />
    <div class="poster" v-show="imgPoster">
      <img class="poster-img" src="../assets/poster-bg.jpg" />
      <div class="close">
        <img src="../assets/close-btn.png" />
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'sharePoster',
  props: {
    showDialog: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      loading: false,
      imgPoster: ''
    };
  }
};
</script>

<style lang="scss" scoped>
.share-page-poster {
  position: relative;
  .loading {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
  }
  .share-wrapper {
    width: 273px;
    /*height: 456px;*/
    position: relative;
  }
  #recommend-poster {
    width: 273px;
    height: 456px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 8px;

    .content-wrap {
      width: 273px;
      height: 370px;
      position: relative;
      .poster-bg {
        width: 273px;
        height: 370px;
        display: block;
      }
      .content {
        width: 100%;
        position: absolute;
        bottom: 3px;
        display: flex;
        justify-content: space-between;
        box-sizing: border-box;
      }
      .store-info {
        padding-top: 4px;
        padding-left: 10px;
        color: #fff;
        .store-name {
          font-size: 14px;
        }
        .store-col {
          display: flex;
          margin-top: 10px;
          img {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            border: 1px solid #fff;
            margin-right: 4px;
          }
        }
      }
      .qrcode-wrap {
        .qrcode {
          width: 70px;
          height: 70px;
          background-color: #fff;
          display: block;
        }
        .qrcode-des {
          font-size: 10px;
          font-family: PingFangSC-Medium;
          font-weight: 500;
          color: #fff;
          margin-top: 3px;
          transform: scale(0.83);
          transform-origin: 0 0;
        }
      }
    }
    .img-share {
      width: 100%;
      height: 86px;
      display: block;
    }
  }

  .poster {
    width: 297px;
    height: 500px;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 8px;
    z-index: 10009;
    .poster-img {
      width: 100%;
      height: 456px;
      border-radius: 8px;
    }

    .close {
      display: flex;
      justify-content: center;
      text-align: center;
      img {
        width: 30px;
        height: 30px;
        display: block;
        margin: 10px 10px;
      }
    }
  }
}
</style>
